package com.sam.im.heiqun.utils;

import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.widget.Toast;

/**
 * Created by leijiawen on 2017/5/16.
 */
public class ToastUtil {
    private static Toast mToast = null ;
    public static void showtoast(Context context,String text){
        try {
            if (null==mToast){
                mToast = Toast.makeText(context,text,Toast.LENGTH_SHORT);

                mToast.setGravity(Gravity.CENTER, 0, 0);
            }
            mToast.setText(text);
            mToast.show();
        }catch (Exception e){
            e.printStackTrace();
        }

    }
}
